package org.huzhp.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.huzhp.model.ApiUser;
import org.huzhp.user.service.IBaseUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("user")
@Api(value = "用户controller", tags = {"用户操作接口"})
public class BaseUserController {

    @Autowired
    private IBaseUserService baseUserService;

    @GetMapping("findUserByCode/{code}")
    @ApiOperation(value = "获取用户信息", notes = "获取用户信息")
    @ApiImplicitParam(name = "code", value = "用户编码")
    public ApiUser findUserByCode(@PathVariable String code) {
        return new ApiUser(baseUserService.findUserByCode(code));
    }

    @PostMapping("findUserByCode")
    public ApiUser findUserByCode1(String code) {
        return new ApiUser(baseUserService.findUserByCode(code));
    }


    @GetMapping("test")
    public String test(String code) {
        return "test";
    }

    @GetMapping("test1")
    public String test1(String code) {
        return "test1";
    }
}
